package com.seadragon.app.ksr.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.seadragon.app.ksr.service.AddressService;

@Service("addressUtility")
public class AddressUtility {
	@Autowired
	private AddressService addressService;
	
	public static void main(String[] args) {
		ApplicationContext appCtx = new ClassPathXmlApplicationContext("ksr-application-context-sa-postgres.xml");
		AddressUtility addressUtility = (AddressUtility)appCtx.getBean("addressUtility");
		addressUtility.geocodeAllAddresses(100);
	}

	public void geocodeAllAddresses(int pageSize){
		addressService.geocodeAll(pageSize);
	}
}
